<template>
  <div>
    <Search :getList="getList" />
    <Table :tableData="tableData" />
    <Pagination :limit="limit" :getList="getList" />
  </div>
</template>

<script>
import Table from "../components/Table.vue";
import Pagination from "../components/Pagination.vue";
import Search from "../components/Search.vue";
export default {
  components: { Table , Pagination , Search },
  data() {
    return {
      tableData: [],
      limit:0,
      num:1
    };
  },
  mounted () {
    this.getList(this.num);
  },
  methods:{
    async getList(num){
      const List = await this.axios("/api/list",{params:{name:typeof(num)==="string"?num:null,pageNum:num,pageSize:5}})
      this.tableData = List.data.dataList;
      this.limit = List.data.limit;
    }
  }
};
</script>

<style>
</style>